function Block(blockID,serverDownText) {
    var beforeOnCompleteFunc = null;
    this.jsEval = true;

    this.dom = function() {
        return $('dom'+blockID);
    }

    this.setGenericParams = function(
                onComplete,
                onFailure,
                evalScripts,
                historyAction
                ) {
                var ha = typeof historyAction === 'string'?historyAction:'';
                var f = typeof onComplete === 'function'?onComplete:function(){};
                beforeOnCompleteFunc = function(req) {
                    var res = f(req);
                    if(!res)
                        return new HistoryItem( ha, new HistoryData(null,null), new HistoryData(null,null));
                    return res;
                }
                this.onFailureFunc = typeof onFailure === 'function'?onFailure:function(){
                                                                    alert(serverDownText);};
                this.jsEval = typeof evalScripts === 'boolean'?evalScripts:true;
    }
    this.update = function(
                url,
                historyAction,
                onComplete,
                onFailure,
                evalScripts
                ) {
                this.setGenericParams(onComplete, onFailure, evalScripts, historyAction);
                this.makeUpdate(blockID,url,{onComplete: this.onCompleteFunc, 
                                        onFailure: this.onFailureFunc,
                                        evalScripts: this.jsEval});
    }
    this.onCompleteFunc = function(request) {
        if(typeof beforeOnCompleteFunc === 'function')
            var r = beforeOnCompleteFunc(request);
        if (!ww.historyEnabled)
            return;
        var cID = $q(historyStorage.special.currentID);
        if(!r.loadData.ID && cID)
            r.loadData.ID = cID;
        if(!r.loadData.html)
            r.loadData.html = request.responseText;
        if(!r.unloadData.ID && cID)
            r.unloadData = new HistoryData(cID,historyStorage.special.html);
        dhtmlHistory.powerAdd(r);
    }
    this.makeRequest = function(url,opt) {
        var o = typeof opt != 'undefined'?opt:{ onComplete: this.onCompleteFunc, 
                                                onFailure: this.onFailureFunc,
                                                evalScripts: this.jsEval};
        new Ajax.Request(url,o);
    }
    this.makeUpdate = function(who,url,opt) {
        var o = typeof opt != 'undefined'?opt:{ onComplete: this.onCompleteFunc, 
                                                onFailure: this.onFailureFunc,
                                                evalScripts: this.jsEval};
        if(ww.historyEnabled) {
            historyStorage.special.currentID = who;
            historyStorage.special.html = $(who).innerHTML;
        }
        new Ajax.Updater($(who),url,o);
    }
}
